<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn" targetNamespace="Examples">

  <process id="subprocess" isExecutable="true">

    <startEvent id="theStart" />
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="outerTask" />
    <userTask id="outerTask" />
    <sequenceFlow id="flow2" sourceRef="outerTask" targetRef="subProcess" />

    <subProcess id="subProcess">
      <extensionElements>
        <camunda:executionListener event="start" delegateExpression="${listener}" />
        <camunda:executionListener event="end" delegateExpression="${listener}" />
      </extensionElements>
      <startEvent id="theSubProcessStart" />
      <sequenceFlow id="flow3" sourceRef="theSubProcessStart" targetRef="innerTask" />
      <userTask id="innerTask">
        <extensionElements>
          <camunda:executionListener event="start" delegateExpression="${listener}" />
          <camunda:executionListener event="end" delegateExpression="${listener}" />
        </extensionElements>
      </userTask>
      <sequenceFlow id="flow4" sourceRef="innerTask" targetRef="theSubProcessEnd" />
      <endEvent id="theSubProcessEnd" />
    </subProcess>

    <sequenceFlow id="flow5" sourceRef="subProcess" targetRef="theEnd" />
    <endEvent id="theEnd" />
  </process>

</definitions>